<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="format-detection" content="telephone=no"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title>台风实时监测与预测</title>

    <style type="text/css">
        <!--
        body {
            font-size: 15pt
        }

        td {
            font-size: 15pt
        }

        -->
    </style>

    <style type=text/css>
        body {
            background-image: url(back_real.jpg);
            background-repeat: no-repeat;
            background-position: center top;
        }
    </style>
</head>
<body>
<?php
/**
 * 查询实时台风数据
 *
 * @author 周利发    zhoulifa@126.com
 */

// ------基本设定------
$config = parse_ini_file("config/db_config.ini");
$server = $config["server"];
$username = $config["username"];
$password = $config["password"];
$database = $config["database"];

//echo 'server: ' . $server;
//echo "\nusername: " . $username;
//echo "\ndatabase: " . $database;

$query = "select * from typhoon_total where num = '20130001'";
//echo $query;
$conn = mysqli_connect($server, $username, $password, $database);
$result = mysqli_query($conn, $query);

// ------判断是否数据库是否有数据返回------
if (mysqli_fetch_row($result) == 0) {
    echo '<br />no total date<br />';
    exit ();
}
mysqli_data_seek($result, 0);
while ($num_result = mysqli_fetch_row($result)) {
    // ------输出表的记录------
    for($i = 0; $i < mysqli_num_fields ( $result ); $i ++) {
        echo $num_result [$i] . ' ';
    }
    echo '<br>';
}

?>
</body>
</html>